let crypto = require('crypto');


/**
 * 对称加密和解密
 * @type {string}
 */

let secret = "12345";
let content = 'xx12';

// 加密
let cipher = crypto.createCipher('aes192', secret);
let enc = cipher.update(content,'utf8','hex');
enc += cipher.final('hex');
console.log('enc:',enc);


// 解密
let decipher = crypto.createDecipher('aes192',secret);
let dec = decipher.update(enc,'hex','utf8');
dec += decipher.final('utf8');
console.log('dec:',dec);
